1. Field of the Invention
The present invention relates to a method, system, program, and computer readable medium for indexing object oriented objects in an object oriented database.
2. Description of the Related Art
An object oriented data base system (OODBMS) provides a persistent and sharable repository and manager of objects defined according to an object-oriented data model. Every object encapsulates a state and behavior. The state of an object comprises the values of the attributes (also referred to as properties) defined for the object, and the behavior of the object comprises the methods provided with the objects. Objects that share the same attributes and methods comprise a class. All the objects maintained in an OODBMS are members of the same class or have the same parent class. This means that the same set of methods defined for the class are used to manipulate the objects in the OODBMS, such as create, delete, add, read, modify, update, etc. Further the objects in a class have the same attributes defined for the class, even though particular attributes within any of the objects in the class may have different values. Objects persistently stored within an OODBMS defined for a class are viewed and distinguished according to the values provided for their attributes. Each object is further provided a unique identifier for use in accessing the object within the OODBMS using the interfaces provided for the class. Benefits and further explanations of object oriented databases are described in xe2x80x9cResearch Directions in Objected-Oriented Database Systemsxe2x80x9d, by Won Kim (Copyright Association of Computing Machinery, 1990); xe2x80x9cIntermedia: A Case Study of the Differences Between Relational and Object-Oriented Database Systemsxe2x80x9d, by Karen E. Smith, Stanley B. Zdonik, OOPSLA ""87 Proceedings (Copyright Association of Computing Machinery, 1987), and U.S. Pat. No. 6,128,771, all of which publications and patents are incorporated herein by reference in their entirety.
Currently, many object oriented database systems are implemented using a Java application programming interface (API).** The application programmer may write APIs in Java to use to access the object oriented database management system (OODBMS). The interfaces to the objects in the OODBMS are also written in Java, and the objects in the OODBMS are implemented as Java classes. In such Java implemented OODBMSs, Java applications can generate Java objects to add to the Java OODBMS and utilize Java APIs to manipulate the Java objects in the Java OODBMS.
In the current OODBMS art, the Java objects being added to the database must be designed to implement the interfaces of the object oriented database class to allow database operations to be performed on the object, such as adding, searching, updating, deleting, etc. Thus, if a developer wants to add already developed objects to an OODBMS, the developer must modify and extend the preexisting objects to implement the object oriented database class. This process to extend pre-existing objects can be cumbersome and time consuming. The need to extend pre-existing objects to implement the object oriented database interface has hindered the widespread use of object oriented database management systems to store and index pre-existing object stores that do not implement the object oriented database class.
Thus, there is a need in the art to provide an improved object oriented database system.
Provided is a method, system, program, and data structures for indexing object oriented objects in an object oriented database. An object data structure is provided including a plurality of object oriented objects, wherein each object includes a key value, and wherein each object is associated with an object index. A node data structure is provided including nodes, wherein each node represents one object in the object store and includes one object index used to access the object represented by the node in the object store. The nodes in the node data structure are organized according to the key values in the objects represented by the nodes. The node data structure is used to access the objects in the object store.
In further implementations, each node is associated with one node index used to access the node in the node data structure and each node is further capable of including one or more node indexes to further nodes. A search key is received. One node is accessed using the node index for the node. The object index in the accessed node is used to access the object in the object store and the key value in the accessed object is accessed. An operation is performed if the accessed key value matches the search key. If the accessed key value does not match the search key and if the accessed node includes a node index to another node, then the node index is used to access the further node and another iteration is performed of the steps of using the object index in the further node to access one object in the object store, accessing the key value in the accessed object, and performing the operation if the accessed key value matches the search key.
Still further, the nodes may form a tree structure, wherein the further node accessed using the node index in one node comprises a child node of the node including the node index.
Yet further, the object data structure and node data structure may comprise an array data structure, wherein the object and node indexes are used to access the associated object and node, respectively, in the array. The array data structure may comprise a one dimensional array that can expand or contract automatically to accommodate adding and removing elements therefrom, such as Java vector.